package com.onion.auth.support;

import com.onion.auth.support.vo.AuthenticationInfo;
import com.onion.auth.support.vo.AuthenticationToken;
import com.onion.auth.support.vo.AuthorizationInfo;

public interface AuthorizeRealm {

    String getName();

    /**
     * 是否支持
     * @param token
     * @return
     */
    boolean isSupported(AuthenticationToken token);

    /**
     * 获取身份认证信息
     * @param token
     * @return
     */
    AuthenticationInfo doGetAuthorizationInfo(AuthenticationToken token);

    /**
     * 获取授权信息
     * @param authenticationInfo
     * @return
     */
    AuthorizationInfo doGetAuthorizationInfo(AuthenticationInfo authenticationInfo);

}